<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>用户新增</title>
	<link href="${ctxPath}/static/theme/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="${ctxPath}/static/theme/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    
    <link href="${ctxPath}/static/theme/css/animate.css" rel="stylesheet">
    <link href="${ctxPath}/static/theme/css/style.css?v=4.1.0" rel="stylesheet">
    
    <script src="${ctxPath}/static/theme/js/jquery.min.js?v=2.1.4"></script>
    <script src="${ctxPath}/static/theme/js/jquery.form.js"></script>
</head>
<body>
  <div class="ibox">
    <div class="ibox-title">
      <h5>新增子系统</h5>
      <div class="ibox-tools">
			<a title="返回" href="${ctxPath}/sys/list" class="btn btn-primary btn-xs"><i class="fa fa-reply"></i></a>
      </div>
    </div>
    <div class="ibox-content">
       <form class="form-horizontal m-t" method="POST" enctype="multipart/form-data" id="project_add" action="${ctxPath}/project/saveProject">
        <div class="form-group">
          <label class="col-sm-1 control-label">项目名称：</label>
          <div class="col-sm-5">
            <input type="text" name="name" class="form-control" placeholder="项目名称" >
          </div>
        </div>
        <div class="form-group">
          <label class="col-sm-1 control-label">项目地址：</label>
          <div class="col-sm-5">
            <input type="text" name="address" class="form-control" placeholder="项目地址" >
          </div>
        </div>
        <div class="form-group">
          <label class="col-sm-1 control-label">是否启用管理：</label>
          <div class="col-sm-3">
             <select name=status id='status' class="form-control">
                  <option value='1'>是</option>
                  <option value='0'>否</option>
             </select>
          </div>
        </div>
          <div class="form-group">
          <label class="col-sm-1 control-label">上传项目logo：</label>
          <div class="col-sm-3">
          	    <input type="file" name="file" class="form-control" placeholder="项目地址" >
          </div>
        </div>
        <div class="form-group">
          <hr>
          <div class="col-sm-12 col-sm-offset-3">
            <button class="btn btn-primary" type="submit" id="submit-btn">保存</button>
            <a  href="${ctxPath}/sys/list" class="btn btn-white goback-btn">取消</a>
          </div>
        </div>
      </form>
    </div>
  </div>
  <script type="text/javascript">
  $(function(){

	  $("#project_add").ajaxForm({
          dataType: "json",
          beforeSend: function() {
          },
          uploadProgress: function(event, position, total, percentComplete) {
          },
          success: function() {
          },
          complete: function(xhr) {
              var data = xhr.responseText;
              data = JSON.parse(data);
              if (data.flag){
            	 alert("新增成功！");
            	 window.location="${ctxPath}/sys/list";
              } else{
              	alert(data.msg);
              }
          }
      });
	})
  </script>
</body>
</html>